import request from '@/utils/request'

export function init() {
  return request({
    url: '/agent/salesman/saleman_bkge_list',
    method: 'GET'
  })
}

export function search(date) {
  return request({
    url: '/agent/salesman/saleman_bkge_list',
    method: 'GET',
    params: { name: date.name, serial_number: date.serial_number, contact_phone: date.contact_phone }
  })
}

export function page(date, page) {
  return request({
    url: '/agent/salesman/saleman_bkge_list',
    method: 'GET',
    params: { name: date.name, serial_number: date.serial_number, contact_phone: date.contact_phone, page }
  })
}

export function recordList(date, page) {
  return request({
    url: 'agent/salesman/record/lists',
    method: 'GET',
    params: { sale_num: date.sale_num, begin_time: date.time ? date.time[0] : '', end_time: date.time ? date.time[1] : '', page }
  })
}

export function refundList(date, page) {
  return request({
    url: 'agent/salesman/refund/lists',
    method: 'GET',
    params: { sale_num: date.sale_num, begin_time: date.begin_time, end_time: date.end_time, page }
  })
}
